package Controlador;

import javax.swing.*;

public class Botones extends JButton{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int numero;

	private ImageIcon iconO=new ImageIcon(".\\src\\res\\O.png");
	private ImageIcon iconX=new ImageIcon(".\\src\\res\\X.png");
	private ImageIcon iconNull=new ImageIcon(".\\src\\res\\N.png");
	public Botones() {
	}

	public Botones(String texto) {
		this.setText(texto);
	}
	
	public Botones(ImageIcon imagen) {
		this.setIcon(imagen);
	}

	
	public void sumarNumero() {
		if (this.getIcon().toString().equals(iconX.toString())) 
		{
			numero = 1;
		} 
		else if (this.getIcon().toString().equals(iconO.toString())) 
		{
			numero = -1;
		}

	}

	public boolean isVacio() {
		if (this.getIcon().toString().equals(iconNull.toString())) {
			return true;
		} else
			return false;
	}

	public void resetear() {
		this.setIcon(iconNull);
		this.setNumero(0);
	}

	public int getNumero() {
		return numero;
	}

	
	public void setNumero(int numero) {
		this.numero = numero;
	}
}
